﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using Zoomtel.Auth.Mvc.Attributes;
using Zoomtel.Entity;
using Zoomtel.Entity.BIZ;
using Zoomtel.Persist.BIZ.Models;
using Zoomtel.Service.BIZ;
using Zoomtel.Web.Controllers;

namespace Zoomtel.Web.Areas.BIZ.Controllers
{
    public class AgentInfoController : BizModuleController
    {
        [HttpPost]
        [AllowAnonymous]
        [Description("点击记录新增")]
        public Task<IResultModel> Add(AgentInfoEntity model)
        {
           
            return _agentInfoService.Add(model);
        }

        AgentInfoService _agentInfoService;

        public AgentInfoController(AgentInfoService agentInfoService)
        {
            _agentInfoService = agentInfoService;
        }

        [Page]
        [HttpGet]
        [Description("分销商列表")]
        public IActionResult Index()
        {
            return View();
        }

        [HttpPost]
        [Description("查询")]
        public Task<IResultModel> Query(AgentQueryModel model)
        {
            return _agentInfoService.Query(model);
        }

        [HttpPut]
        [Description("状态更新")]
        public Task<IResultModel> UpdateStatus(string ids,string status)
        {
            return _agentInfoService.UpdateStatus(ids,status);
        }

        [HttpPost]
        [Description("修改余额")]
        public Task<IResultModel> UpdateBalance(AgentInfoEntity model)
        {
            return _agentInfoService.UpdateBalance(model);
        }


   

    }
}
